<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            height: 400px;
            width: 400px;
            background-color:black;
        }
        .btn1{
            float: inline-end;
        }
        .btn2{
            display: none;
        }
    </style>
</head>
<body>
    <div>
        <button class="btn1">关闭原神
        </button>
    </div>
    <button class="btn2" >原神启动</button>
    

    <script>

        // const btn = document.querySelector('button')
        // btn.addEventListener('click',function(){
        //     alert('元神启动了')
        // })
        const btn1 = document.querySelector('.btn1')
        const btn2 = document.querySelector('.btn2')
        const div = document.querySelector('div')
        btn1.addEventListener('click',function(){
            div.style.display = 'none'
            alert('呜呜呜 原神被关闭了！！！')
            btn2.style.display = 'block'
            btn2.addEventListener('click',function(){
                div.style.display = 'block'
                alert('✌✌✌,原神又启动了耶！！！')
            })
        })



    </script>


</body>
</html>